package org.openstreetmap.josm.plugins.cadastre_es;

//import javax.swing.JLabel;
import static org.openstreetmap.josm.tools.I18n.tr;
import java.net.URL;
import javax.swing.ImageIcon;
import javax.swing.JProgressBar;

public class ProgressFrame extends javax.swing.JFrame {
    private static final long serialVersionUID = -6983927633237544211L;
    //private JLabel statusText;
    
    private JProgressBar progressBar;

    public ProgressFrame() {
        super(tr("Importing buildings..."));
        initComponents();
    }
    
    private void initComponents() {
        progressBar = new JProgressBar(0, 100);
        progressBar.setIndeterminate(true);
        progressBar.setStringPainted(true);
        add(progressBar);
        
        URL imgURL = getClass().getResource("/images/cadastre-select.png");
        if (imgURL != null) {
            ImageIcon image = (new ImageIcon(imgURL));
            setIconImage(image.getImage());
        }
        setLocationRelativeTo(null);
        pack();
        setVisible(true);
        
        //statusText = new JLabel();
    }
    
    public void setProgress(int status) {
        if (progressBar.isIndeterminate())
            progressBar.setIndeterminate(false);
        progressBar.setValue(status);
    }
}
